package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFillInsert;
import com.sky.annotation.AutoFillUpdate;
import com.sky.entity.Dish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {
    @Select("select count(*) from dish where category_id=#{id}")
    Long seleceByCategoryId(Long id);

    Integer selectCount(Dish dish);
@AutoFillInsert
    void insert(Dish dish);

    Page<Dish> selectPage(Dish dish);

    Integer selectCountById(List<String> ids, Integer status);


    void deleteByIds(List<String> ids);

    @Select("select *  from dish where id=#{id}")
    Dish seletById(Long id);

    @AutoFillUpdate
    void updateById(Dish dish);

    @Select("select * from dish where category_id=#{categoryId}")
    List<Dish> selet(Long categoryId);
}
